From: Florian Müllner Date: Mon, 4 Feb 2019 12:22:41 +0000 (+0100) Subject: runDialog: Don't return from finally block X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~845^2^2~103 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=2c1a81f448fb73bece5b8c928ff5877b22a086a3;p=gnome-shell.git runDialog: Don't return from finally block Control flow statements like return, break or continue are considered unsafe in finally blocks, as they take precendence over any control flow statement in the try and catch blocks, which may be unexpected. This isn't the case here as the statement in the finally block is the only one, but we can just as well avoid the finally block altogether and use a regular return statement. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/606 --- diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index a4ac8c82b..9186ff7bb 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -169,9 +169,8 @@ class RunDialog extends ModalDialog.ModalDialog { if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND) && !e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_DIRECTORY)) log(e); - } finally { - return results; } + return results; }); let results = someResults.reduce((a, b) => a.concat(b), []);